import request from '@/utils/request'

export function getRole(data) {
  return request({
    url: '/sys/role',
    data
  })
}

export function addRole(data) {
  return request({
    url: '/sys/role',
    method: 'post',
    data
  })
}

export function delRole(data) {
  return request({
    url: '/sys/role/' + data,
    method: 'delete'
  })
}

export function getRoleDetail(data) {
  return request({
    url: '/sys/role/' + data
  })
}

export function updateRole(data) {
  return request({
    url: '/sys/role/' + data.id,
    method: 'put',
    data
  })
}

export function companyInfo(companyId) {
  return request({
    url: '/company/' + companyId
  })
}

export function setRole(data) {
  return request({
    url: '/sys/role/assignPrem',
    method: 'put',
    data
  })
}
